<template>
  <div id="play-lists-topic">
    <span class="title">热门标签:</span>
    <span
      v-for="(item, index) in hotTags"
      :key="index"
      class="tags">
      <span
        class="tag"
        @click="tagClick">{{ item.name }}</span>
      <span class="split">|</span>
    </span>
  </div>
</template>

<script>
export default {
  name: 'PlaylistsTopic',
  props: {
    hotTags: {
      type: Array
    }
  },
  methods: {
    tagClick (e) {
      this.$emit('tagClick', e.target.innerText)
      // console.log(e.target.innerText)
    }
  }
}
</script>

<style scoped lang="less">
#play-lists-topic {
  width: 100%;
  font-size: 14px;
  .title {
    padding-right: 12px;
  }
  .tags {
    .tag {
      color: rgba(0, 0, 0, 0.8);
      cursor: pointer;
    }
    .split {
      padding: 0 12px;
    }
    &:last-child .split {
      display: none;
    }
  }
}
</style>
